package com.utis;

public class MyTK {

    public static void main(String[] args) {
        System.out.println(sum(7));
    }


    public static int sum(int N){
        if (N<2){
            return 0;
        }

        int sum = 0;//定义求和 并初始化
        for (int i = 1; i < N; i++) {//循环
            sum += getNum(i);//求和
        }
       return sum;




    }

    public static int getNum(int T) {
        if (T == 1 || T == 2) {//如果n为1 返回1
            return 1;
        } else {//否则返回n-1与n-2的数值的相加
            return getNum(T - 1) + getNum(T - 2);
        }
    }

}
